home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 405_01 / flexpp / flexskel.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-17  |  24.1 KB  |  1,014 lines

  1. /* A lexical scanner generated by flex */
  2. /* scanner skeleton version:
  3.  * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
  4.  */
  5. /* MODIFIED FOR C++ CLASS BY Alain Coetmeur: coetmeur(at)icdc.fr */
  6. /* Note that (at) mean the 'at' symbol that I cannot write */
  7. /* because it is expanded to the class name */
  8. /* made at Informatique-CDC, Research&development department */
  9. /* company from the Caisse Des Depots et Consignations */
  10. /* institutional financial group  */
  11.  
  12. /* theses symbols are added before this file */
  13. /* #define YY_CHAR 'unsigned char' if 8bit or 'char' if 7bit */
  14. /* #define FLEX_DEBUG if debug mode */
  15. #define FLEX_SCANNER
  16. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  17. #ifdef c_plusplus
  18. #ifndef __cplusplus
  19. #define __cplusplus
  20. #endif
  21. #endif
  22. /* Old MSC, before c7 */
  23. #ifdef MSDOS
  24. #ifndef _MSDOS
  25. #define _MSDOS
  26. #endif
  27. #endif
  28. /* turboc */
  29. #ifdef __MSDOS__
  30. #ifndef _MSDOS
  31. #define _MSDOS
  32. #endif
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. #include <stdlib.h>
  37. #define YY_USE_CONST
  38. #define YY_USE_PROTOS
  39. #ifndef YY_USE_CLASS
  40. #define YY_USE_CLASS
  41. #endif
  42. #ifndef _MSDOS
  43. #include <osfcn.h>
  44. #endif
  45. #else   /* ! __cplusplus */
  46. #ifdef __STDC__
  47. #ifdef __GNUC__
  48. #include <stddef.h>
  49. void *malloc( size_t );
  50. void free( void* );
  51. int read();
  52. #else
  53. #include <stdlib.h>
  54. #endif  /* __GNUC__ */
  55. #define YY_USE_PROTOS
  56. #define YY_USE_CONST
  57. #endif  /* __STDC__ */
  58. #endif  /* ! __cplusplus */
  59. #ifdef __TURBOC__
  60. #define YY_USE_CONST
  61. #endif
  62. #include <stdio.h>
  63.  
  64.  
  65. /*********************************************/
  66. /* COMPILER DEPENDENT   MACROS               */
  67. /*********************************************/
  68. /* use prototypes in function declarations */
  69. /* the "const" storage-class-modifier is valid */
  70. #ifndef YY_USE_CONST
  71. #define const
  72. #endif
  73. /* use prototypes in function declarations */
  74. #ifndef YY_PROTO
  75. #ifdef YY_USE_PROTOS
  76. #define YY_PROTO(proto) proto
  77. #else
  78. #define YY_PROTO(proto) ()
  79. #endif
  80. #endif
  81.  
  82.  
  83. /*********************/
  84. /* parameters        */
  85.  
  86. /* amount of stuff to slurp up with each read */
  87. #ifndef YY_READ_BUF_SIZE
  88. #define YY_READ_BUF_SIZE 8192
  89. #endif
  90. /* size of default input buffer */
  91. #ifndef YY_BUF_SIZE
  92. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) 
  93. #endif
  94.  
  95. /***********************************/
  96. /* to be redefined for application */
  97.  
  98. /* returned upon end-of-file */
  99. #define YY_END_TOK 0
  100. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  101.  * we don't want an extra ';' after the "return" because that will cause
  102.  * some compilers to complain about unreachable statements.
  103.  */
  104. #define yyterminate() return ( YY_NULL )
  105.  
  106. /* code executed at the end of each rule */
  107. #define YY_BREAK break;
  108.  
  109. /* #define YY_USER_ACTION */
  110. /* #define YY_USER_INIT */
  111.  
  112.  
  113. #ifndef YY_USE_CLASS
  114. /* copy whatever the last rule matched to the standard output */
  115. /* cast to (char *) is because for 8-bit chars, yy___text is (unsigned char *) */
  116. /* this used to be an fputs(), but since the string might contain NUL's,
  117.  * we now use fwrite()
  118.  */
  119. #define ECHO (void) fwrite( (char *) yy___text, yy___leng, 1, yy___out )
  120.  
  121. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  122.  * is returned in "result".
  123.  */
  124. #ifdef _MSDOS
  125. #define YY_INPUT(buf,result,max_size) \
  126.     if ( (result = fread(buf,1,max_size,yy___in)) < 0 ) \
  127.         YY_FATAL_ERROR( "fread() in flex scanner failed" );
  128. #else
  129. #define YY_INPUT(buf,result,max_size) \
  130.     if ( (result = read( fileno(yy___in), (char *) buf, max_size )) < 0 ) \
  131.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  132.  
  133. #endif
  134. /* report a fatal error */
  135.  
  136. /* The funky do-while is used to turn this macro definition into
  137.  * a single C statement (which needs a semi-colon terminator).
  138.  * This avoids problems with code like:
  139.  *
  140.  *      if ( something_happens )
  141.  *              YY_FATAL_ERROR( "oops, the something happened" );
  142.  *      else
  143.  *              everything_okay();
  144.  *
  145.  * Prior to using the do-while the compiler would get upset at the
  146.  * "else" because it interpreted the "if" statement as being all
  147.  * done when it reached the ';' after the YY_FATAL_ERROR() call.
  148.  */
  149.  
  150. #define YY_FATAL_ERROR(msg) \
  151.     do \
  152.         { \
  153.         (void) fputs( msg, stderr ); \
  154.         (void) putc( '\n', stderr ); \
  155.         exit( 1 ); \
  156.         } \
  157.     while ( 0 )
  158.  
  159. /* default yywrap function - always treat EOF as an EOF */
  160. #define yywrap() 1
  161.  
  162.  
  163. /* default declaration of generated scanner - a define so the user can
  164.  * easily add parameters
  165.  */
  166. #define YY_DECL int yylex YY_PROTO(( void )) 
  167. #else 
  168. /* c++ */
  169. #define ECHO yy___echo()
  170. #define YY_INPUT(buf,result,max_size) \
  171.     if ( yy___input((char *)buf, result,max_size) < 0 ) \
  172.         YY_FATAL_ERROR( "YY_INPUT() in flex scanner failed" );
  173.  
  174. #define YY_FATAL_ERROR(msg) yy___fatal_error(msg)
  175. #define yywrap() yy___wrap()
  176.  
  177. #endif
  178. /***********************************/
  179. /* not to be changed */
  180. #define YY_NULL 0
  181. #define YY_END_OF_BUFFER_CHAR 0
  182. /* special action meaning "start processing a new file" */
  183. #define YY_NEW_FILE yy___newfile 
  184. /* enter a start condition.  This macro really ought to take a parameter,
  185.  * but we do it the disgusting crufty way forced on us by the ()-less
  186.  * definition of BEGIN
  187.  */
  188. #define BEGIN yy_start = 1 + 2 *
  189.  
  190. /* action number for EOF rule of a given start state */
  191. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  192.  
  193.  
  194.  
  195. %% section 1 definitions go here
  196.  
  197. #define yy___text YY_@_TEXT
  198. #define yy___leng YY_@_LENG
  199. #define yy___in YY_@_IN
  200. #define yy___out YY_@_OUT
  201. #define yy___newfile \
  202.     do \
  203.         { \
  204.         YY_@_INIT_BUFFER( yy_current_buffer, yy___in ); \
  205.         YY_@_LOAD_BUFFER_STATE(); \
  206.         } \
  207.     while ( 0 )
  208. #if YY_@_DEBUG != 0
  209. #define yy___flex_debug YY_@_DEBUG_FLAG
  210. #endif
  211.  
  212.  
  213. #ifdef YY_USE_CLASS
  214.  
  215. #define yy___echo YY_@_ECHO
  216. #define yy___input YY_@_INPUT
  217. #define yy___fatal_error YY_@_FATAL_ERROR
  218. #define yy___wrap YY_@_WRAP
  219.  
  220. #endif
  221.  
  222. /* done after the current pattern has been matched and before the
  223.  * corresponding action - sets up yy___text
  224.  */
  225. #define YY_DO_BEFORE_ACTION \
  226.     yy___text = yy_bp; \
  227. %% code to fiddle yy___text and yy___leng for yymore() goes here
  228.     yy_hold_char = *yy_cp; \
  229.     *yy_cp = '\0'; \
  230.     yy_c_buf_p = yy_cp;
  231.  
  232. #define EOB_ACT_CONTINUE_SCAN 0
  233. #define EOB_ACT_END_OF_FILE 1
  234. #define EOB_ACT_LAST_MATCH 2
  235.  
  236. /* return all but the first 'n' matched characters back to the input stream */
  237. #define yyless(n) \
  238.     do \
  239.         { \
  240.         /* undo effects of setting up yy___text */ \
  241.         *yy_cp = yy_hold_char; \
  242.         yy_c_buf_p = yy_cp = yy_bp + n; \
  243.         YY_DO_BEFORE_ACTION; /* set up yy___text again */ \
  244.         } \
  245.     while ( 0 )
  246.  
  247. #define unput(c) yyunput( c, yy___text )
  248.  
  249.  
  250.  
  251. struct yy_buffer_state
  252.     {
  253.     FILE *yy_input_file;
  254.  
  255.     YY_@_CHAR *yy_ch_buf;               /* input buffer */
  256.     YY_@_CHAR *yy_buf_pos;      /* current position in input buffer */
  257.  
  258.     /* size of input buffer in bytes, not including room for EOB characters */
  259.     int yy_buf_size;    
  260.  
  261.     /* number of characters read into yy_ch_buf, not including EOB characters */
  262.     int yy_n_chars;
  263.  
  264.     int yy_eof_status;          /* whether we've seen an EOF on this buffer */
  265. #define EOF_NOT_SEEN 0
  266.     /* "pending" happens when the EOF has been seen but there's still
  267.      * some text process
  268.      */
  269. #define EOF_PENDING 1
  270. #define EOF_DONE 2
  271.     };
  272.  
  273. /* we provide macros for accessing buffer states in case in the
  274.  * future we want to put the buffer states in a more general
  275.  * "scanner state"
  276.  */
  277.  
  278. #ifndef YY_USE_CLASS
  279.  
  280. #if YY_@_DEBUG != 0
  281. int YY_@_DEBUG_FLAG=YY_@_DEBUG_INIT;
  282. #endif
  283. #define YY_CURRENT_BUFFER yy_current_buffer
  284. static YY_BUFFER_STATE yy_current_buffer;
  285. /* yy_hold_char holds the character lost when yy___text is formed */
  286. static YY_@_CHAR yy_hold_char;
  287.  
  288. static int yy_n_chars;          /* number of characters read into yy_ch_buf */
  289.  
  290. /* GLOBAL */
  291. YY_@_CHAR *yy___text;
  292. int yy___leng;
  293.  
  294. FILE *yy___in = (FILE *) 0, *yy___out = (FILE *) 0;
  295.  
  296. #ifdef __cplusplus
  297. static int yyinput YY_PROTO(( void ));
  298. #else
  299. static int input YY_PROTO(( void ));
  300. #endif
  301. /* these variables are all declared out here so that section 3 code can
  302.  * manipulate them
  303.  */
  304. /* points to current character in buffer */
  305. static YY_@_CHAR *yy_c_buf_p = (YY_@_CHAR *) 0;
  306. static int yy_init = 1;         /* whether we need to initialize */
  307. static int yy_start = 0;        /* start state number */
  308.  
  309. /* flag which is used to allow yywrap()'s to do buffer switches
  310.  * instead of setting up a fresh yy___in.  A bit of a hack ...
  311.  */
  312. static int yy_did_buffer_switch_on_eof;
  313.  
  314. static int yy_get_next_buffer YY_PROTO(( void ));
  315. static void yyunput YY_PROTO(( YY_@_CHAR c, YY_@_CHAR *buf_ptr ));
  316.  
  317. #else
  318. /* c++ */
  319. #ifndef YY_@_ECHO_NOCODE
  320. void YY_@_CLASS::yy___echo()
  321. {YY_@_ECHO_CODE
  322. }
  323. #endif
  324. #ifndef YY_@_INPUT_NOCODE
  325. int  YY_@_CLASS::yy___input(char * buffer,int &result,int max_size)
  326. {YY_@_INPUT_CODE
  327. }
  328. #endif
  329. #ifndef YY_@_FATAL_ERROR_NOCODE
  330. void YY_@_CLASS::yy___fatal_error(char *msg)
  331. {YY_@_FATAL_ERROR_CODE
  332. }
  333. #endif
  334. #ifndef YY_@_WRAP_NOCODE
  335. int  YY_@_CLASS::yy___wrap()
  336. {YY_@_WRAP_CODE
  337. }
  338. #endif
  339. void YY_@_CLASS::yy_initialize()
  340. {
  341.  yy___in=0;yy___out=0;yy_init = 1;
  342.  yy_start=0;
  343.  yy___text=0;yy___leng=0;
  344.  yy_current_buffer=0;
  345.  yy_did_buffer_switch_on_eof=0;
  346.  yy_c_buf_p=0;yy_hold_char=0;yy_n_chars=0;
  347. #if YY_@_DEBUG != 0
  348.  YY_@_DEBUG_FLAG=YY_@_DEBUG_INIT;
  349. #endif
  350. }
  351.  
  352. YY_@_CLASS::YY_@_CLASS(YY_@_CONSTRUCTOR_PARAM) YY_@_CONSTRUCTOR_INIT
  353. {yy_initialize();
  354.  YY_@_CONSTRUCTOR_CODE;
  355. }
  356.  
  357. #endif
  358.  
  359.  
  360. #ifndef YY_USER_ACTION
  361. #define YY_USER_ACTION
  362. #endif
  363.  
  364. #ifndef YY_USER_INIT
  365. #define YY_USER_INIT
  366. #endif
  367.  
  368. %% data tables for the DFA go here
  369. #ifndef YY_USE_CLASS
  370. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  371. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  372. #else
  373. #define yy_get_previous_state() ((yy_state_type)(yy_get_previous_state_()))
  374. #define yy_try_NUL_trans(c) ((yy_state_type)(yy_try_NUL_trans_(c)))
  375. #endif
  376.  
  377. #ifndef YY_USE_CLASS
  378. #ifdef YY_@_LEX_DEFINED
  379. YY_@_LEX_RETURN YY_@_LEX ( YY_@_LEX_PARAM )
  380. YY_@_LEX_PARAM_DEF
  381. #else
  382. YY_DECL
  383. #endif
  384. #else
  385. YY_@_LEX_RETURN YY_@_CLASS::YY_@_LEX ( YY_@_LEX_PARAM)
  386.  
  387. #endif
  388.     {
  389.     register yy_state_type yy_current_state;
  390.     register YY_@_CHAR *yy_cp, *yy_bp;
  391.     register int yy_act;
  392.  
  393. %% user's declarations go here
  394.  
  395.     if ( yy_init )
  396.     {
  397.      
  398.      {
  399.      YY_USER_INIT;
  400.      }
  401.     if ( ! yy_start )
  402.         yy_start = 1;       /* first start state */
  403.  
  404.     if ( ! yy___in )
  405.         yy___in = stdin;
  406.  
  407.     if ( ! yy___out )
  408.         yy___out = stdout;
  409.  
  410.     if ( yy_current_buffer )
  411.         YY_@_INIT_BUFFER( yy_current_buffer, yy___in );
  412.     else
  413.         yy_current_buffer = YY_@_CREATE_BUFFER( yy___in, YY_BUF_SIZE );
  414.  
  415.     YY_@_LOAD_BUFFER_STATE();
  416.     yy_init=0;
  417.     }
  418.  
  419.     while ( 1 )         /* loops until end-of-file is reached */
  420.     {
  421. %% yymore()-related code goes here
  422.     yy_cp = yy_c_buf_p;
  423.  
  424.     /* support of yy___text */
  425.     *yy_cp = yy_hold_char;
  426.  
  427.     /* yy_bp points to the position in yy_ch_buf of the start of the
  428.      * current run.
  429.      */
  430.     yy_bp = yy_cp;
  431.  
  432. %% code to set up and find next match goes here
  433.  
  434. yy_find_action:
  435. %% code to find the action number goes here
  436.  
  437.     YY_DO_BEFORE_ACTION;
  438.     YY_USER_ACTION;
  439.  
  440. do_action:      /* this label is used only to access EOF actions */
  441. #if YY_@_DEBUG != 0
  442.     if ( yy___flex_debug )
  443.         {
  444.         if ( yy_act == 0 )
  445.             fprintf( stderr, "--scanner backtracking\n" );
  446.         else if ( yy_act < YY_END_OF_BUFFER -1 )
  447.             fprintf( stderr, 
  448.              "--accepting rule at line %d (\"%s\")\n",
  449.              yy_rule_linenum[yy_act], yy___text );
  450.         else if ( yy_act == YY_END_OF_BUFFER -1 )
  451.             fprintf( stderr, 
  452.              "--accepting default rule (\"%s\")\n",
  453.              yy___text );
  454.         else if ( yy_act == YY_END_OF_BUFFER )
  455.             fprintf( stderr, "--(end of buffer or a NUL)\n" );
  456.         else
  457.             fprintf( stderr, "--EOF\n" );
  458.         }
  459. #endif
  460.     switch ( yy_act )
  461.         {
  462. %% actions go here
  463.  
  464.         case YY_END_OF_BUFFER:
  465.         {
  466.         /* amount of text matched not including the EOB char */
  467.         int yy_amount_of_matched_text = yy_cp - yy___text - 1;
  468.  
  469.         /* undo the effects of YY_DO_BEFORE_ACTION */
  470.         *yy_cp = yy_hold_char;
  471.  
  472.         /* note that here we test for yy_c_buf_p "<=" to the position
  473.          * of the first EOB in the buffer, since yy_c_buf_p will
  474.          * already have been incremented past the NUL character
  475.          * (since all states make transitions on EOB to the end-
  476.          * of-buffer state).  Contrast this with the test in yyinput().
  477.          */
  478.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  479.             /* this was really a NUL */
  480.             {
  481.             yy_state_type yy_next_state;
  482.  
  483.             yy_c_buf_p = yy___text + yy_amount_of_matched_text;
  484.  
  485.             yy_current_state = yy_get_previous_state();
  486.  
  487.             /* okay, we're now positioned to make the
  488.              * NUL transition.  We couldn't have
  489.              * yy_get_previous_state() go ahead and do it
  490.              * for us because it doesn't know how to deal
  491.              * with the possibility of jamming (and we
  492.              * don't want to build jamming into it because
  493.              * then it will run more slowly)
  494.              */
  495.  
  496.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  497.  
  498.             yy_bp = yy___text + YY_MORE_ADJ;
  499.  
  500.             if ( yy_next_state )
  501.             {
  502.             /* consume the NUL */
  503.             yy_cp = ++yy_c_buf_p;
  504.             yy_current_state = yy_next_state;
  505.             goto yy_match;
  506.             }
  507.  
  508.             else
  509.             {
  510. %% code to do backtracking for compressed tables and set up yy_cp goes here
  511.             goto yy_find_action;
  512.             }
  513.             }
  514.  
  515.         else switch ( yy_get_next_buffer() )
  516.             {
  517.             case EOB_ACT_END_OF_FILE:
  518.             {
  519.             yy_did_buffer_switch_on_eof = 0;
  520.  
  521.             if ( yywrap() )
  522.                 {
  523.                 /* note: because we've taken care in
  524.                  * yy_get_next_buffer() to have set up yy___text,
  525.                  * we can now set up yy_c_buf_p so that if some
  526.                  * total hoser (like flex itself) wants
  527.                  * to call the scanner after we return the
  528.                  * YY_NULL, it'll still work - another YY_NULL
  529.                  * will get returned.
  530.                  */
  531.                 yy_c_buf_p = yy___text + YY_MORE_ADJ;
  532.  
  533.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  534.                 goto do_action;
  535.                 }
  536.  
  537.             else
  538.                 {
  539.                 if ( ! yy_did_buffer_switch_on_eof )
  540.                 YY_NEW_FILE;
  541.                 }
  542.             }
  543.             break;
  544.  
  545.             case EOB_ACT_CONTINUE_SCAN:
  546.             yy_c_buf_p = yy___text + yy_amount_of_matched_text;
  547.  
  548.             yy_current_state = yy_get_previous_state();
  549.  
  550.             yy_cp = yy_c_buf_p;
  551.             yy_bp = yy___text + YY_MORE_ADJ;
  552.             goto yy_match;
  553.  
  554.             case EOB_ACT_LAST_MATCH:
  555.             yy_c_buf_p =
  556.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  557.  
  558.             yy_current_state = yy_get_previous_state();
  559.  
  560.             yy_cp = yy_c_buf_p;
  561.             yy_bp = yy___text + YY_MORE_ADJ;
  562.             goto yy_find_action;
  563.             }
  564.         break;
  565.         }
  566.  
  567.         default:
  568. #if YY_@_DEBUG != 0
  569.         fprintf(stderr, "action # %d\n", yy_act );
  570. #endif
  571.         YY_FATAL_ERROR(
  572.             "fatal flex scanner internal error--no action found" );
  573.         }
  574.     }
  575.     yyterminate();/* avoid the no return value error message on MS-C7/dos */
  576.     }
  577.  
  578.  
  579. /* yy_get_next_buffer - try to read in a new buffer
  580.  *
  581.  * synopsis
  582.  *     int yy_get_next_buffer();
  583.  *     
  584.  * returns a code representing an action
  585.  *     EOB_ACT_LAST_MATCH - 
  586.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  587.  *     EOB_ACT_END_OF_FILE - end of file
  588.  */
  589. #ifndef YY_USE_CLASS
  590. static int yy_get_next_buffer()
  591. #else
  592. int YY_@_CLASS::yy_get_next_buffer()
  593. #endif
  594.     {
  595.     register YY_@_CHAR *dest = yy_current_buffer->yy_ch_buf;
  596.     register YY_@_CHAR *source = yy___text - 1; /* copy prev. char, too */
  597.     register int number_to_move, i;
  598.     int ret_val;
  599.  
  600.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  601.     YY_FATAL_ERROR(
  602.         "fatal flex scanner internal error--end of buffer missed" );
  603.  
  604.     /* try to read more data */
  605.  
  606.     /* first move last chars to start of buffer */
  607.     number_to_move = yy_c_buf_p - yy___text;
  608.  
  609.     for ( i = 0; i < number_to_move; ++i )
  610.     *(dest++) = *(source++);
  611.  
  612.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  613.     /* don't do the read, it's not guaranteed to return an EOF,
  614.      * just force an EOF
  615.      */
  616.     yy_n_chars = 0;
  617.  
  618.     else
  619.     {
  620.     int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  621.  
  622.     if ( num_to_read > YY_READ_BUF_SIZE )
  623.         num_to_read = YY_READ_BUF_SIZE;
  624.  
  625.     else if ( num_to_read <= 0 )
  626.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  627.  
  628.     /* read in more data */
  629.     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  630.           yy_n_chars, num_to_read );
  631.     }
  632.  
  633.     if ( yy_n_chars == 0 )
  634.     {
  635.     if ( number_to_move - YY_MORE_ADJ == 1 )
  636.         {
  637.         ret_val = EOB_ACT_END_OF_FILE;
  638.         yy_current_buffer->yy_eof_status = EOF_DONE;
  639.         }
  640.  
  641.     else
  642.         {
  643.         ret_val = EOB_ACT_LAST_MATCH;
  644.         yy_current_buffer->yy_eof_status = EOF_PENDING;
  645.         }
  646.     }
  647.  
  648.     else
  649.     ret_val = EOB_ACT_CONTINUE_SCAN;
  650.  
  651.     yy_n_chars += number_to_move;
  652.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  653.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  654.  
  655.     /* yy___text begins at the second character in yy_ch_buf; the first
  656.      * character is the one which preceded it before reading in the latest
  657.      * buffer; it needs to be kept around in case it's a newline, so
  658.      * yy_get_previous_state() will have with '^' rules active
  659.      */
  660.  
  661.     yy___text = &yy_current_buffer->yy_ch_buf[1];
  662.  
  663.     return ( ret_val );
  664.     }
  665.  
  666.  
  667. /* yy_get_previous_state - get the state just before the EOB char was reached
  668.  *
  669.  * synopsis
  670.  *     yy_state_type yy_get_previous_state();
  671.  */
  672.  
  673. #ifndef YY_USE_CLASS
  674. static yy_state_type yy_get_previous_state()
  675. #else
  676. long YY_@_CLASS::yy_get_previous_state_()
  677. #endif
  678.     {
  679.     register yy_state_type yy_current_state;
  680.     register YY_@_CHAR *yy_cp;
  681.  
  682. %% code to get the start state into yy_current_state goes here
  683.  
  684.     for ( yy_cp = yy___text + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  685.     {
  686. %% code to find the next state goes here
  687.     }
  688.  
  689. #ifndef YY_USE_CLASS
  690.     return ( yy_current_state );
  691. #else
  692.     return (long)( yy_current_state );
  693. #endif
  694.     }
  695.  
  696.  
  697. /* yy_try_NUL_trans - try to make a transition on the NUL character
  698.  *
  699.  * synopsis
  700.  *     next_state = yy_try_NUL_trans( current_state );
  701.  */
  702.  
  703. #ifndef YY_USE_CLASS
  704. #ifdef YY_USE_PROTOS
  705. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  706. #else
  707. static yy_state_type yy_try_NUL_trans( yy_current_state )
  708. register yy_state_type yy_current_state;
  709. #endif
  710. #else
  711. long YY_@_CLASS::yy_try_NUL_trans_(long yy_current_state_)
  712. #endif
  713.  
  714.     {
  715. #ifndef YY_USE_CLASS
  716. #else
  717.     yy_state_type yy_current_state=(yy_state_type)yy_current_state_;
  718. #endif
  719.     register int yy_is_jam;
  720. %% code to find the next state, and perhaps do backtracking, goes here
  721.  
  722. #ifndef YY_USE_CLASS
  723.     return ( yy_is_jam ? 0 : yy_current_state );
  724. #else
  725.     return (long)( yy_is_jam ? 0 : yy_current_state );
  726. #endif
  727.     }
  728.  
  729. #ifndef YY_USE_CLASS
  730. #ifdef YY_USE_PROTOS
  731. static void yyunput( YY_@_CHAR c, register YY_@_CHAR *yy_bp )
  732. #else
  733. static void yyunput( c, yy_bp )
  734. YY_@_CHAR c;
  735. register YY_@_CHAR *yy_bp;
  736. #endif
  737. #else
  738. void YY_@_CLASS::yyunput( YY_@_CHAR c, YY_@_CHAR *yy_bp )
  739. #endif
  740.  
  741.     {
  742.     register YY_@_CHAR *yy_cp = yy_c_buf_p;
  743.  
  744.     /* undo effects of setting up yy___text */
  745.     *yy_cp = yy_hold_char;
  746.  
  747.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  748.     { /* need to shift things up to make room */
  749.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  750.     register YY_@_CHAR *dest =
  751.         &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  752.     register YY_@_CHAR *source =
  753.         &yy_current_buffer->yy_ch_buf[number_to_move];
  754.  
  755.     while ( source > yy_current_buffer->yy_ch_buf )
  756.         *--dest = *--source;
  757.  
  758.     yy_cp += dest - source;
  759.     yy_bp += dest - source;
  760.     yy_n_chars = yy_current_buffer->yy_buf_size;
  761.  
  762.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  763.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  764.     }
  765.  
  766.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  767.     yy_cp[-2] = '\n';
  768.  
  769.     *--yy_cp = c;
  770.  
  771.     /* note: the formal parameter *must* be called "yy_bp" for this
  772.      *       macro to now work correctly
  773.      */
  774.     YY_DO_BEFORE_ACTION; /* set up yy___text again */
  775.     }
  776.  
  777. #ifndef YY_USE_CLASS
  778. #ifdef __cplusplus
  779. static int yyinput()
  780. #else
  781. static int input()
  782. #endif
  783. #else
  784. int YY_@_CLASS::input()
  785. #endif
  786.     {
  787.     int c;
  788.     YY_@_CHAR *yy_cp = yy_c_buf_p;
  789.  
  790.     *yy_cp = yy_hold_char;
  791.  
  792.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  793.     {
  794.     /* yy_c_buf_p now points to the character we want to return.
  795.      * If this occurs *before* the EOB characters, then it's a
  796.      * valid NUL; if not, then we've hit the end of the buffer.
  797.      */
  798.     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  799.         /* this was really a NUL */
  800.         *yy_c_buf_p = '\0';
  801.  
  802.     else
  803.         { /* need more input */
  804.         yy___text = yy_c_buf_p;
  805.         ++yy_c_buf_p;
  806.  
  807.         switch ( yy_get_next_buffer() )
  808.         {
  809.         case EOB_ACT_END_OF_FILE:
  810.             {
  811.             if ( yywrap() )
  812.             {
  813.             yy_c_buf_p = yy___text + YY_MORE_ADJ;
  814.             return ( EOF );
  815.             }
  816.  
  817.             YY_NEW_FILE;
  818. #ifndef YY_USE_CLASS
  819. #ifdef __cplusplus
  820.             return ( yyinput() );
  821. #else
  822.             return ( input() );
  823. #endif
  824. #else
  825.             return ( input() );
  826. #endif
  827.             }
  828.             break;
  829.  
  830.         case EOB_ACT_CONTINUE_SCAN:
  831.             yy_c_buf_p = yy___text + YY_MORE_ADJ;
  832.             break;
  833.  
  834.         case EOB_ACT_LAST_MATCH:
  835. #ifndef YY_USE_CLASS
  836. #ifdef __cplusplus
  837.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  838. #else
  839.             YY_FATAL_ERROR( "unexpected last match in input()" );
  840. #endif
  841. #else
  842.             YY_FATAL_ERROR( "unexpected last match in YY_@_CLASS::input()" );
  843. #endif
  844.         }
  845.         }
  846.     }
  847.  
  848.     c = *yy_c_buf_p;
  849.     yy_hold_char = *++yy_c_buf_p;
  850.  
  851.     return ( c );
  852.     }
  853.  
  854.  
  855. #ifndef YY_USE_CLASS
  856. #ifdef YY_USE_PROTOS
  857. void YY_@_RESTART( FILE *input_file )
  858. #else
  859. void YY_@_RESTART( input_file )
  860. FILE *input_file;
  861. #endif
  862. #else
  863. void YY_@_CLASS::YY_@_RESTART ( FILE *input_file )
  864. #endif
  865.  
  866.     {
  867.     YY_@_INIT_BUFFER( yy_current_buffer, input_file );
  868.     YY_@_LOAD_BUFFER_STATE();
  869.     }
  870.  
  871.  
  872. #ifndef YY_USE_CLASS
  873. #ifdef YY_USE_PROTOS
  874. void YY_@_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer )
  875. #else
  876. void YY_@_SWITCH_TO_BUFFER( new_buffer )
  877. YY_BUFFER_STATE new_buffer;
  878. #endif
  879. #else
  880. void YY_@_CLASS::YY_@_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer )
  881. #endif
  882.  
  883.     {
  884.     if ( yy_current_buffer == new_buffer )
  885.     return;
  886.  
  887.     if ( yy_current_buffer )
  888.     {
  889.     /* flush out information for old buffer */
  890.     *yy_c_buf_p = yy_hold_char;
  891.     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  892.     yy_current_buffer->yy_n_chars = yy_n_chars;
  893.     }
  894.  
  895.     yy_current_buffer = new_buffer;
  896.     YY_@_LOAD_BUFFER_STATE();
  897.  
  898.     /* we don't actually know whether we did this switch during
  899.      * EOF (yywrap()) processing, but the only time this flag
  900.      * is looked at is after yywrap() is called, so it's safe
  901.      * to go ahead and always set it.
  902.      */
  903.     yy_did_buffer_switch_on_eof = 1;
  904.     }
  905.  
  906.  
  907. #ifndef YY_USE_CLASS
  908. #ifdef YY_USE_PROTOS
  909. void YY_@_LOAD_BUFFER_STATE( void )
  910. #else
  911. void YY_@_LOAD_BUFFER_STATE()
  912. #endif
  913. #else
  914. void YY_@_CLASS::YY_@_LOAD_BUFFER_STATE(  )
  915. #endif
  916.  
  917.     {
  918.     yy_n_chars = yy_current_buffer->yy_n_chars;
  919.     yy___text = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  920.     yy___in = yy_current_buffer->yy_input_file;
  921.     yy_hold_char = *yy_c_buf_p;
  922.     }
  923.  
  924.  
  925. #ifndef YY_USE_CLASS
  926. #ifdef YY_USE_PROTOS
  927. YY_BUFFER_STATE YY_@_CREATE_BUFFER( FILE *file, int size )
  928. #else
  929. YY_BUFFER_STATE YY_@_CREATE_BUFFER( file, size )
  930. FILE *file;
  931. int size;
  932. #endif
  933. #else
  934. YY_BUFFER_STATE YY_@_CLASS::YY_@_CREATE_BUFFER( FILE *file, int size )
  935. #endif
  936.  
  937.     {
  938.     YY_BUFFER_STATE b;
  939.  
  940.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  941.  
  942.     if ( ! b )
  943.     YY_FATAL_ERROR( "out of dynamic memory in YY_@_CREATE_BUFFER()" );
  944.  
  945.     b->yy_buf_size = size;
  946.  
  947.     /* yy_ch_buf has to be 2 characters longer than the size given because
  948.      * we need to put in 2 end-of-buffer characters.
  949.      */
  950.     b->yy_ch_buf = (YY_@_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  951.  
  952.     if ( ! b->yy_ch_buf )
  953.     YY_FATAL_ERROR( "out of dynamic memory in YY_@_CREATE_BUFFER()" );
  954.  
  955.     YY_@_INIT_BUFFER( b, file );
  956.  
  957.     return ( b );
  958.     }
  959.  
  960.  
  961. #ifndef YY_USE_CLASS
  962. #ifdef YY_USE_PROTOS
  963. void YY_@_DELETE_BUFFER( YY_BUFFER_STATE b )
  964. #else
  965. void YY_@_DELETE_BUFFER( b )
  966. YY_BUFFER_STATE b;
  967. #endif
  968. #else
  969. void YY_@_CLASS::YY_@_DELETE_BUFFER( YY_BUFFER_STATE b )
  970. #endif
  971.  
  972.     {
  973.     if ( b == yy_current_buffer )
  974.     yy_current_buffer = (YY_BUFFER_STATE) 0;
  975.  
  976.     free( (char *) b->yy_ch_buf );
  977.     free( (char *) b );
  978.     }
  979.  
  980.  
  981. #ifndef YY_USE_CLASS
  982. #ifdef YY_USE_PROTOS
  983. void YY_@_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file )
  984. #else
  985. void YY_@_INIT_BUFFER( b, file )
  986. YY_BUFFER_STATE b;
  987. FILE *file;
  988. #endif
  989. #else
  990. void YY_@_CLASS::YY_@_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file)
  991. #endif
  992.  
  993.     {
  994.     b->yy_input_file = file;
  995.  
  996.     /* we put in the '\n' and start reading from [1] so that an
  997.      * initial match-at-newline will be true.
  998.      */
  999.  
  1000.     b->yy_ch_buf[0] = '\n';
  1001.     b->yy_n_chars = 1;
  1002.  
  1003.     /* we always need two end-of-buffer characters.  The first causes
  1004.      * a transition to the end-of-buffer state.  The second causes
  1005.      * a jam in that state.
  1006.      */
  1007.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1008.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1009.  
  1010.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1011.  
  1012.     b->yy_eof_status = EOF_NOT_SEEN;
  1013.     }
  1014.